package com.imooc.demo.Service.Impl;

import com.imooc.demo.Mapper.BgmMapper;
import com.imooc.demo.Model.bgm;
import com.imooc.demo.Service.BgmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
public class BgmServiceImpl implements BgmService {
    @Resource
    private BgmMapper bgmMapper;

    @Transactional(propagation = Propagation.SUPPORTS)
    @Override
    public List<bgm> queryAllBgm() {
        return bgmMapper.selectAll();
    }

    @Transactional(propagation = Propagation.SUPPORTS)
    @Override
    public bgm queryByBgmId(Integer BgmId) {
        return bgmMapper.selectByPrimaryKey(BgmId);
    }
}
